package com.emmmya.ocs.modules.system.vo;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.emmmya.ocs.modules.system.entity.Role;
import com.emmmya.ocs.common.base.BaseVo;
import lombok.Data;
import lombok.ToString;

/**
 * @description: mybatis的分页查询条件
 * @author: 咕噜肉IT小店-黑医
 * @createDate: 2020-12-24
 * @version: 1.0
 */
@Data
@ToString
public class RoleVo extends BaseVo<Role> {
    private String roleName;

    /*角色说明*/
    private String remarks;

    /**
     * 当前页码
     */
    private Integer page;

    /**
     * 每页数量
     */
    private Integer limit;


    @Override
    public QueryWrapper createWrapper() {
        if(wrapper == null){
            wrapper = new QueryWrapper<>();
        }
        wrapper.like("role_name",this.getRoleName());
        return wrapper;
    }

    @Override
    public IPage<Role> createPage() {
        return new Page<Role>(this.getPage(),this.getLimit());
    }


}
